home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 4463 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  1.1 KB

  1. Path: beavis.kronos.com!usenet
  2. From: lipsett@kronos.com (Roger Lipsett)
  3. Newsgroups: comp.lang.c++
  4. Subject: Derivation and protected members
  5. Date: 30 Jan 1996 13:57:37 GMT
  6. Organization: Kronos, Inc.
  7. Message-ID: <4el84h$t86@beavis.kronos.com>
  8. NNTP-Posting-Host: 158.228.13.99
  9. Mime-Version: 1.0
  10. Content-Type: Text/Plain; charset=US-ASCII
  11. X-Newsreader: WinVN 0.99.7
  12.  
  13. Suppose I have a base class, bas, and a derived class, der, of which bas is a
  14. public base. der has additional data members beyond those provided by bas. All 
  15. data members of both classes are protected.
  16.  
  17. I wish to define an operation (=) that will assign an instance of bas to an 
  18. instance of der by setting all of der's data members that are inherited from 
  19. bas to the values as provided by the instance of bas, and leaving untouched
  20. the other data members of der..
  21.  
  22. There appears to be no simple way to do this. The der-instance does not have
  23. access to the protected members of the bas-instance, as those members are
  24. protected. What am I missing here?
  25.  
  26. Thanks in advance,
  27. Roger Lipsett
  28. Kronos, Inc.
  29. 400 Fifth Ave.
  30. Waltham MA 02154
  31.  
  32. internet: lipsett@kronos.com
  33. phone:    (617) 487-4776
  34.  
  35.  
  36.